/**
 * @file timerbtn.h
 * @brief 实现一个按钮附带有定时器的功能
 * @author zhaobohan (zhaobohan_free@163.com)
 * @version 0.1
 * @date 2024-07-05
 */
#ifndef TIMERBTN_H
#define TIMERBTN_H
#include <QPushButton>
#include <QTimer>

class TimerBtn : public QPushButton
{
public:
    TimerBtn(QWidget *parent = nullptr);
    ~ TimerBtn();

    // 重写mouseReleaseEvent
    virtual void mouseReleaseEvent(QMouseEvent *e) override;
private:
    QTimer  *_timer;
    int _counter;
};

#endif // TIMERBTN_H
